import { EntityBasePoint } from "./EntityBasePoint";
import { ERelationType } from "../../../../../Message/Public/ERelationType";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { SMapEntityPoint } from "../../../../../Message/BroadCast/SMapEntityPoint";
//class EntityMapPoint
    
    export  class EntityMapPoint extends EntityBasePoint
    {
        constructor()
        {
            super();
            this.mouseChildren = false;
            this.mouseEnabled = false;
            return;
        }

        protected /* override */ updatePointView(): void
        {
            if (this._entityPoint) 
            {
                var loc1=this._entityPoint.relationType;
                switch (loc1) 
                {
                    case ERelationType._ERelationEnemy:
                    {
                        _bitMap.bitmapData = GlobalClass.getBitmapData(ImagesConst.MapUIBoss);
                        break;
                    }
                    case ERelationType._ERelationFriend:
                    {
                        _bitMap.bitmapData = GlobalClass.getBitmapData(ImagesConst.MapUIFriend);
                        break;
                    }
                }
                _bitMap.x = (-_bitMap.width) / 2;
                _bitMap.y = (-_bitMap.height) / 2;
            }
            return;
        }

        protected /* override */ updateObj(arg1: Object): void
        {
            if (typeof arg1 === "smapentitypoint") 
            {
                this._entityPoint = arg1 as SMapEntityPoint;
                _entityId = this._entityPoint.entityId;
            }
            return;
        }

        public /* override */ dispose(): void
        {
            super.dispose();
            this._entityPoint = null;
            return;
        }

        public /* override */ get toolTipData()
        {
            return "";
        }

        protected /* var */_entityPoint: SMapEntityPoint;
    }
